<?php
class SqlServer{
	//数据库连接参数
	public $connect = array();
	public $logs;
	//sqlServer数据库连接
	public function SqlServerConnection(){
		$connectionInfo = array("UID"=>$this->connect['DB_USER_CMDB'], "PWD"=>$this->connect['DB_PASSWORD_CMDB'], "Database"=>$this->connect['DB_DATABASE_CMDB']);
		$SqlLink = sqlsrv_connect($this->connect['DB_HOST_CMDB'], $connectionInfo);
		if($SqlLink == false){
			$txt = "连接失败!"."\r\n";
			fwrite($this->logs,$txt);
			echo 0;
			die;
		}else{
			/* echo 'SqlServer  OK';
			echo '<br/>'; */
			$txt = "SqlServer  OK"."\r\n";
			fwrite($this->logs,$txt);
		}
		return $SqlLink;
	}
	public function __destruct() {
		unset($SqlLink);
	}
}
    
?>